<?php
	namespace Admin\Model;
	use Think\Model;

	class AddverModel extends Model{
		public function getAll(){
			$list=$this->select();
			return $list;
		}

		public function change($status,$id){
			$data['status']=!$status;
			$this->where("id=$id")->save($data);
		}

		public function setadd($data,$filename){
			$this->startTrans();

				$img=M('Addver');
				$data['name']=$filename;
				$res=$img->data($data)->add();
				if($res){
					$this->commit();
					return true;
				}else{
					$this->rollback();
					return false;
				}

		}





	}